fxmatrix.htmTEXThbwr!VÓπ{> π{> ÅÅ<[ FX Matrix
FX Matrix

Applies a filter as it copies an image from one canvas to another.

Syntax

FX Matrix filter[],source,dest

Description

source and dest are the canvases to copy the image between.

filter[] is an array of numbers that defines the filter that is applied as the image is copied.

The filter is applied to each of the pixels in turn until the entire image is copied.

Each pixel in the dest canvas is calculated using the filter and the pixels from the source canvas.

Suppose we have a filter which is specified like this...

0,0,0
0,1,0
0,0,0

Suppose the filter is currently being applied to pixel x,y. The pixel x,y in the dest canvas is calculated like this...

pixel x-1, y-1 * 0 +
pixel x, y-1 * 0 +

pixel x+1, y-1 *
0 +

pixel x-1, y * 0 +
pixel x, y * 1 +
pixel x+1, y * 0 +

pixel x-1, y+1 * 0 +
pixel x, y+1 * 0 +
pixel x+1, y+1 * 0

This works out as a direct copy from one canvas to the other.

The filter is only applied to the pixels in the canvas that it can be. eg. if the filter is 5 pixels wide then it will not be applied to the pixels which are 2 pixels or less away from the edges. This is because the dest pixel cannot be calculated since the filter would go off the sides of the source canvas.

Note: This function only works in software mode.


Table of contents
ÄÄn,O¸H Monacot Ät ĵtI*Ä1© TNT Software 2000ÄÄn&% ˜nPMwp"MPSR.vers:MWBBFˡˇÌˇˇ ˇˇ Xˇˇx